const path = require('path');
const CssMinimizerPlugin = require("css-minimizer-webpack-plugin");

const P = (...args) => path.resolve(__dirname, '../', ...args)
module.exports = {
    mode: 'production',
    optimization: {
        runtimeChunk: 'single',
        splitChunks: {
            cacheGroups: {
                vendor: {
                    test: /[\\/]node_modules[\\/]/,
                    name: 'vendors',
                    chunks: 'all',
                },
            },
        },
        minimizer: [
            `...`,
            new CssMinimizerPlugin(),
        ],
    },
};